

<template>
  <div class="common-layout">
    <el-container>
      <el-header class="head">
        <h1>商机信息列表</h1>
      </el-header>
      <el-main>
        <div class="main-top">
          <div class="btn"><el-button type="primary" @click="newht">新增商机</el-button></div>
          <div class="ipt">
            <el-input v-model="input2" class="ipt1" placeholder="请输入关键字">
            </el-input>
            <el-select v-model="select" placeholder="全部" class="iptselt">
            <el-option label="全部" value="1" /> 
              <el-option label="编号" value="2" />
              <el-option label="机构名称" value="3" />
              <el-option label="机构级别" value="4" />
              <el-option label="阶段状态" value="5" />
              <el-option label="跟进状态" value="6" />
              <el-option label="经办人" value="7" />
              <el-option label="联系人" value="8" />
              <el-option label="审核状态" value="9" /> 
           
            </el-select>
            <el-button type="primary">查询</el-button>
          </div>
        </div>

        <el-table
          ref="multipleTableRef"
          :data="tableData"
          style="width: 100%"
          class="tab"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="55" />
          <el-table-column label="编号" width="60">
            <template #default="scope">{{ scope.row.id }}</template>
          </el-table-column>
          <el-table-column property="htname" label="机构名称" width="120" />
          <el-table-column
            property="jgname"
            label="机构级别"
            show-overflow-tooltip
            width="200"
          />
          <el-table-column
            property="httype"
            label="阶段状态"
            show-overflow-tooltip
            width="100"
          />
          <el-table-column
            property="htmoney"
            label="跟进状态"
            show-overflow-tooltip
          />
          <el-table-column property="jbren" label="经办人" width="120" />
          <el-table-column
            property="shzhuangtai"
            label="联系人"
            show-overflow-tooltip
            width="100"
          />
          <el-table-column
            property="qgdata"
            label="审核状态"
            show-overflow-tooltip
            width="100"
          />
          <!-- <el-table-column property="qgdata" label="签约日期" width="120" />
          <el-table-column property="dqdate" label="到期日期" width="120" /> -->
          <el-table-column prop="address" label="操作">
            <template #default="scope">
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="editRow(scope.row)"
                >编辑</el-button
              >
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.row)"
                >删除</el-button
              >
              <el-button
                link
                type="primary"
                size="small"
                @click.prevent="deleteRow(scope.row)"
                >查看</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </el-main>
    </el-container>
  </div>

  <div>
    
  </div>
</template>

<script lang="ts" setup>
import { ref,reactive,onMounted } from "vue";
import { useRouter } from "vue-router";
import { ElTable } from "element-plus";
import axios from "axios";
import {
  user_list,
  delete_user_list,
  searchuseinfo_user_list,
} from "../../../../utils/hwj_api/businessApi.js";

var router = useRouter();
const textarea = ref("");
const value = ref("");
var newht = () => {
  router.push('/index/home/hwj/business')
}
interface User {
  id: string;
  htname: string;
  jgname: string;
  httype: string;
  htmoney: string;
  jbren: string;
  // jbren1:string;
  shzhuangtai: string;
  qgdata: string;
  // dqdate: string;
}


const multipleTableRef = ref<InstanceType<typeof ElTable>>();
const multipleSelection = ref<User[]>([]);
const toggleSelection = (rows?: User[]) => {
  if (rows) {
    rows.forEach((row) => {
      multipleTableRef.value!.toggleRowSelection(row, undefined);
    });
  } else {
    multipleTableRef.value!.clearSelection();
  }
};
const handleSelectionChange = (val: User[]) => {
  multipleSelection.value = val;
};

const tableData: User[] = [
  {
    id: "100021",
    htname: "南阳医学高等专科学校图书馆",
    jgname: "学校",
    httype: "谈判/合同",
    htmoney: "成交",
    jbren: "夏小芳",
    shzhuangtai: "周青玲",
    qgdata: "未审核",
  
  },
  {
   id: "100022",
    htname: "山东工业职业学院图书馆",
    jgname: "学校",
    httype: "需求确定",
    htmoney: "报价",
    jbren: "向闲",
    shzhuangtai: "何立军",
    qgdata: "已审核",
  },
  {
    id: "100023",
    htname: "闽南理工学院图书馆",
    jgname: "学校",
    httype: "方案/报价",
    htmoney: "成交",
    jbren: "何雯",
    shzhuangtai: "李英国",
    qgdata: "已审核",
  },
  {
    id: "100021",
    htname: "南阳医学高等专科学校图书馆",
    jgname: "学校",
    httype: "谈判/合同",
    htmoney: "成交",
    jbren: "夏小芳",
    shzhuangtai: "周青玲",
    qgdata: "已审核",
  },
  {
    id: "100024",
    htname: "武汉工程职业技术学院图书馆",
    jgname: "学校",
    httype: "谈判/合同",
    htmoney: "成交",
    jbren: "张雷",
    shzhuangtai: "赵阳",
    qgdata: "未审核",
  },
  {
  id: "100025",
    htname: "湖南艺术职业学院图书馆",
    jgname: "学校",
    httype: "需求确定",
    htmoney: "报价",
    jbren: "赵红雨",
    shzhuangtai: "李小凡",
    qgdata: "已审核",
  },
  {
     id: "100026",
    htname: "重庆城市管理职业学院图书馆",
    jgname: "学校",
    httype: "方案/报价",
    htmoney: "成交",
    jbren: "夏小芳",
    shzhuangtai: "冯小兰",
    qgdata: "未审核",
  },
  {
 id: "100027",
    htname: "安徽省宣城市宣州孙埠高级中学",
    jgname: "学校",
    httype: "谈判/合同",
    htmoney: "成交",
    jbren: "夏小芳",
    shzhuangtai: "冯小兰",
    qgdata: "未审核",
  },
    {
    id: "100028",
    htname: "长治市科技情报研究所",
    jgname: "企事业",
    httype: "需求确定",
    htmoney: "报价",
    jbren: "张丽",
    shzhuangtai: "童小伟",
    qgdata: "已审核",
  },
];
const tableData1 = reactive({ list: [] });

onMounted(()=>{
  axios.get('/api/user/list').then((res)=>{
    console.log(res.data.list);
    tableData1.list = res.data.list;
  })
})
// const tableData1 = reactive({ list: [] });
// // 查询list
// var searchlist = () => {
//   axios.post("/api/user/search", { id: textarea.value, num: value._value })
//     .then((res) => {
//       console.log("search", res);
//       //   console.log("num", value._value);
//       // console.log("tableData.list", tableData.list);
//       tableData1.list = res.data.list;
//     });
// };
// //编辑员工信息
// var editRow = (row) => {
//   console.log(row);
//   searchuseinfo_user_list({ id: row.id }).then((res) => {
//     router.push({
//       path: "/index/home/hwj/businessedit",
//       query: row,
//     });
//   });
// };

</script>

<style scoped>
.head {
  text-align: center;
  font-weight: bolder;
  font-size: 38px;
  margin-bottom: 50px;
}
.main-top {
  height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid gainsboro;
  /* background-color: aqua; */
}
.btn {
  width: 150px;
  height: 50px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  /* background-color: chartreuse; */
}
.ipt {
  width: 500px;
  height: 50px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  /* background-color: fuchsia; */
}
.ipt1 {
  width: 280px;
  height: 30px;
}
.iptselt {
  width: 125px;
  height: 25px;
}
.tab {
  /* font-size: 13px; */
  text-align: center;
}
</style>

















